package com.example.sfm.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author sfm
 * @since 2025-03-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("announcements")
@Schema(name = "Announcements对象",description = "公告表")
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Announcements implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "公告ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "公告标题")
    private String title;

    @Schema(description = "公告内容")
    private String content;

    @Schema(description = "发布者ID")
    private Integer authorId;

    @Schema(description = "浏览次数")
    private Integer views;

    @Schema(description = "优先级（0=低, 1=普通, 2=高）")
    private Integer priority;

    @Schema(description = "发布时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @Schema(description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

}
